home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-27 | 35.6 KB | 1,156 lines |
-
-
- TREXXTRA, The TEXTRA-to-ARexx Command Interface!
-
- (The mother-of-all-concatenated-names!!!)
-
- again, by Mike Haas (who else?)
-
-
-
- *** Many THANX to Martin Kees, who generously contributed ***
- his AREXX original interface design and implementation.
-
- *** Many THANX to James Cooper of SAS Institute, Inc. ***
- for contributing the SAS/C interface scripts.
-
- *** Many THANX to all the registered users who have reported ***
- bugs and contributed a wealth of much-appreciated
- suggestions for our favorite editor.
-
- And to youse guys at Commodore-Amiga, past, present
- and future, for the obvious.
-
-
- This document describes the TEXTRA commands that may be placed
- within ARexx scripts and launched from within TEXTRA via the
- "Utilities, AREXX..." menu item or key-equivalent.
-
- TEXTRA introduced its ARexx interface in v1.10. I'll make every
- attempt to keep later versions backward-compatible and NOT break
- any existing scripts later on.
-
- This document describes the feature set of Textra Version 1.15.
- A complete Revision History for the ARexx interface is at end
- of this document.
-
-
- A Quick example...
-
- Before trying anything, copy the provided TEXTRA ARexx script
- files, the ones in the provided "Scripts" directory, into your
- rexx: directory. The provided Textra_Install program will do that
- for you automatically. (This need be done only once and completes
- the TEXTRA AREXX Interface installation on your system.)
-
- (Alternatively, you could temporarily assign rexx: to the Scripts
- directory. If necessary, refer to your Amiga System Manuals for
- information about any of these operations.)
-
- Launch TEXTRA by double-clicking on it's icon and click on the
- 'CANCEL' button on the file requester.
-
- Pull-down the "Utilities, AREXX..." menu item and, if not already
- present, enter Tutorial into one of the string gadgets and press
- RETURN. (Note: you can clear one first with Rt-Amiga-X, if
- necessary).
-
- Please feel free to use the provided scripts as a basis for developing
- your own ARexx programs, if you are inclined to such things. If you
- do, and can see your way clear, please send me a copy of your stuff...
- if you wish it to be included in the standard release package, include
- a signed statement to that effect, OK?
-
- Mike Haas
- 3867 La Colina Rd.
- El Sobrante, CA. 94803
-
-
-
- AREXX Scripts containing the TEXTRA commands described in
- this file may reside in either of 2 places:
-
- 1. The REXX: directory (if you have one ASSIGNed)
-
- OR
-
- 2. The Textra "startup" directory...
-
- a. If you launch TEXTRA from Workbench, this is the same
- directory that TEXTRA is in.
-
- b. If you run TEXTRA from CLI/Shell, this is the "current
- directory" of the CLI/Shell when you launch Textra.
-
-
-
- Notes about TEXTRA Command Invocations from ARexx scripts...
-
- 1. When specifying strings in TEXTRA commands, encase them
- in double-quotes, even if there is no whitespace.
- (Otherwise, ARexx will convert all your characters to
- UPPER case. Nice of it, huh?)
-
- 2. Script usage is case-INsensitive for the TEXTRA commands
- and keyword-matching.
-
- 3. TEXTRA will sometimes set combinations of 2 pre-defined
- AREXX variables, RESULT and RC (return code). Both are
- strings, RESULT being primarily informational in nature
- and RC used for error situation return values
- ('out-of-range value' or 'not found' type error codes).
-
- Note that to retrieve the RESULT string, if used, the
- AREXX program must have declared OPTIONS RESULTS
- somewhere previously. RC is always available and TEXTRA
- will return 0 in it for a SUCCESS condition or a non-zero
- value (5 is considered a minor condition, 10 is the more
- serious type, etc.).
-
-
- The remainder of this document is divided into the following
- sections, each describing commands related to that topic...
-
- Movement commands
- Set Selected Area
- Operations on Selected Areas
- Interactive Control
- File/Window Management
-
- There is some overlap to the functionality of these sections,
- so if you're looking for a specific capability, scan everything.
-
- The commands themselves...
-
-
- ===================================================================
- Movement Commands
- ===================================================================
-
-
- GOTOXY x y move cursor to x y position
-
- Place the cursor to the given 'x y' coordinates, where
- 'x' is the decimal column position (starting with 0) and 'y'
- is the decimal line number (starting with 0).
-
- 'rc' set to:
-
- 0 = 'x y' within range of text
- 5 = 'x' too large (cursor positioned to end-of-line)
- 10 = 'y' too large (no change in cursor/selection)
-
-
- GOTOXY1 x y move cursor to x y position (1's-based)
-
- This command is identical with GOTOXY, except that it accepts
- 'x' and 'y' arguments which start with 1 (passing less than 1 for
- either will set 'rc' as indicated above).
-
-
- UP n cursor up n lines
-
- 'rc' set to:
-
- 0 = cursor position was successfully changed by at least 1 line
- 5 = cursor was at top line to begin with
-
-
- DOWN n cursor down n lines
-
- 'rc' set to:
-
- 0 = cursor position was successfully changed by at least 1 line
- 5 = cursor was at bottom line to begin with
-
-
- RIGHT n cursor right n characters
-
- 'rc' set to:
-
- 0 = cursor position was successfully changed by at least 1 column
- 5 = cursor was at last character in file to begin with
-
-
- LEFT n cursor left n characters
-
- 'rc' set to:
-
- 0 = cursor position was successfully changed by at least 1 column
- 5 = cursor was at first character in file to begin with
-
-
- FIRSTLINE cursor to beg of file (rc always = 0)
-
-
- LASTLINE cursor to end of file (rc always = 0)
-
-
- TOP cursor up to topline of visable page (rc always = 0)
-
-
- BOTTOM cursor to bottom line of visable page (rc always = 0)
-
-
- CENTER cursor to middle line (rc always = 0)
-
-
- HOPTO next word cursor to start of next word
- HOPTO prev word cursor to END of prev word
- HOPTO next char cursor to next non-white
- HOPTO prev char cursor to prev non-white
- HOPTO next blank cursor to next whitespace char
- HOPTO prev blank cursor to prev whitespace char
-
- HOPTO moves the cursor to a specific position relative to the
- current cursor or selection location. The direction and
- ultimate destination position is determined by the keywords
- provided.
-
- HOPTO observes the current setting of the PREFS attribute
- 'AlphanumericHops' (see the PREFS command) to determine how it
- skips over characters and words.
-
- 'rc' set to:
-
- 0 = SUCCESS
- 10 = keywords supplied to HOPTO were invalid
-
- if 'rc' = 0, 'result' set to:
-
- "<number>" = cursor column
- "NOT FOUND" = could not HOPTO (at one end of file)
-
-
- LINE <num>
-
- Positions the cursor at the beginning of the specified
- line (relative to 0). Specifying -1 will place the cursor
- at the beginning of the current cursor line. If a select
- range exists, the line on which it starts is considered
- the 'current' line.
-
- For results, see GOTOXY.
-
-
- LINE1 <num> *** 1's based ***
-
- Same as LINE, but 1's-based. For results, see GOTOXY.
-
-
- COLUMN <num>
-
- Positions the cursor at column <num> of the current
- line (relative to 0). Specifying -1 will move the cursor
- to the end of the current cursor line. If a select
- range exists, the line on which it starts is considered
- the 'current' line.
-
- For results, see GOTOXY.
-
-
- COLUMN1 <num> *** 1's based ***
-
- Same as COLUMN, but 1's-based. For results, see GOTOXY.
-
-
- ===================================================================
- Set Selected Area
- ===================================================================
-
-
- SELECTLINE n select and display line n
-
- Same as the 'Go to Line...' menu item. No effect if 'line n'
- is not both a valid decimal number and in range for the file.
- (rc always = 0)
-
-
- FIND "text" find "text", observe wrap setting
-
- Find and select the specified text. The search is case-INsensitive.
-
- 'result' set to:
-
- "OK" = text has been located, selected and displayed
- "NOT FOUND" = could not be found
-
- (rc always = 0)
-
-
- FINDNEXT
-
- Conducts another search for the same string, see FIND.
-
-
- SELECTTO x y
-
- Used to establish or modify a select range as follows:
-
- - If 'x y' is below the current cursor location or start
- of selection, 'x y' then becomes the new start of selection.
-
- - If 'x y' is after the current cursor location or end of
- selection, 'x y' then becomes the new end of selection.
-
- - If 'x y' is within the current selection, then 'x y' becomes
- the new end of selection.
-
- (rc always = 0)
-
-
- HOPSELECT next word
- HOPSELECT prev word
- HOPSELECT next char
- HOPSELECT prev char
-
- HOPSELECT establishes a selection relative to the current
- cursor or selection location. The direction and destination
- selection is determined by the keywords provided.
-
- HOPSELECT observes the current setting of the PREFS attribute
- 'AlphanumericHops' (see the PREFS command) to determine how it
- selects characters and words.
-
- 'rc' set to:
-
- 0 = SUCCESS
- 10 = keywords supplied to HOPSELECT were invalid
-
- if 'rc' = 0, 'result' set to:
-
- "<number>" = length of selected string
- "NOT FOUND" = could not HOPSELECT (at one end of file)
-
-
- UNSELECT make sure nothing is selected
-
- If there is a selection, place the cursor at the end of it.
- No effect if nothing selected.
- (rc always = 0)
-
-
- ===================================================================
- Operations on Selected Areas
- ===================================================================
-
-
- CUT
-
- Same as the 'CUT' menu item. No effect if nothing selected.
- rc = 30 if window is write protected, otherwise 0
-
-
- COPY
-
- Same as the 'COPY' menu item. No effect if nothing selected.
- (rc always = 0)
-
-
- PASTE
-
- Same as the 'PASTE' menu item. No effect if nothing has been
- CUT or COPY'ed. rc = 30 if window is write protected, otherwise 0
-
-
- KILLSELECT
-
- If a select range exists, delete it. Do NOT save it in the
- clipboard. rc = 30 if window is write protected, otherwise 0
-
- 'result' set to:
-
- "OK" if a select range existed. The cursor will now reside
- where the select range previously began.
-
- "NO SELECT" = There is no selection. (nothing is changed)
- "WRITE PROTECTED" = window must be unlocked, see WRITEENABLE
-
-
- LOCASE
-
- Selected or next word to lower case. rc = 30 if window is
- write protected, otherwise 0
-
-
- HICASE
-
- Selected or next word to upper case. rc = 30 if window is
- write protected, otherwise 0
-
-
- CAPS
-
- Capitalize the selected or next word. rc = 30 if window is
- write protected, otherwise 0
-
-
- ===================================================================
- INTERACTIVE Control
- ===================================================================
-
-
- TEXT token
-
- Inserts the 'token' into the current window at the current
- cursor location. If a select range exists, it is deleted
- before the insertion. rc = 30 if window is write protected,
- otherwise 0
-
-
- TEXTN token
-
- Same as TEXT, but includes a newline after the specified string.
- rc = 30 if window is write protected, otherwise 0
-
-
- NEWLINE
-
- Inserts a newline into the current window at the current
- cursor location. If a select range exists, it is deleted
- before the insertion. rc = 30 if window is write protected,
- otherwise 0
-
-
- BACKSPACE
-
- Same behavior as the BackSpace key on the keyboard.
- rc = 30 if window is write protected, otherwise 0
-
-
- DEL
-
- Same behavior as the DEL key on the keyboard.
- rc = 30 if window is write protected, otherwise 0
-
-
- PREFS attribute action
-
- Perform an action to the specified Edit or Printing Preferences
- attribute. The action may be to either read and return the
- current setting of the attribute, or set it.
-
- The valid attribute keywords are listed here, along with the
- appropriate action keywords for each...
-
- Usage: PREFS [AutoIndent] [read on off]
- [AutoBackspace] [read on off]
- [PrintLineNumbers] [read on off]
- [PrintPageHeaders] [read on off]
- [TabWidth] [read <value>]
- [Alphanumeric] [read on off]
- [AlphanumericHops] [read on off]
- [WrapFind] [read on off]
-
- If the action is 'read', the returned string will either be
- "ON", "OFF", or "<value>", depending on whether the attribute
- is a 'state' or 'numeric' variable.
-
- example: PREFS AutoIndent read
- AIstatus = result /* should be ON or OFF */
-
- If the action is to set the attribute, then the action keyword
- will be either "ON", "OFF" or "<value>", depending on whether
- the attribute is a 'state' or 'numeric' variable. If the
- attribute is successfully set, the string "OK" will be returned.
-
- NOTE: setting the PREFS Alphanumeric attribute to 'off'
- automatically infers the 'Non-Whitespace" mode of selecting
- text on double-click mouse events.
-
- NOTE: the PREFS AlphanumericHops [read on off] attribute,
- determines how the HOPTO and HOPSELECT commands will look
- at text. Turning this attribute off automatically infers
- the 'Non-Whitespace" mode of parsing text.
-
- NOTE: the WrapFind setting is initialized to OFF at the beginning
- of each script or command invocation. This attribute applies
- ONLY to the FIND and FINDNEXT commands (is independant of
- the Wrap setting in the FIND STRING... requester).
-
- examples: PREFS AutoIndent on
- AIstatus = result /* should be OK */
-
- PREFS TabWidth read
- notify result
-
- 'rc' set to:
-
- 0 = SUCCESS
- 10 = keywords supplied to PREFS were invalid
-
- if 'rc' = 0 and action is "read", 'result' set to:
-
- "<number>" = if requested attribute is numeric in nature
- "ON" or "OFF" = if requested attribute is a 'state'
-
-
- GET item attribute
-
- GET is used to aquire information about a certain 'attribute'
- of a particular 'item'.
-
- 'rc' set to:
-
- 0 = SUCCESS
- 10 = keywords supplied to GET were invalid
-
- Assuming the given keyword pairs are valid (in the following list),
- 'result' will be set as indicated.
-
- A brief summary of the available reports:
-
- GET cursor position - report column & line of cursor
- GET cursor char - report character at cursor position
- GET file name - get just the filename (no path)
- GET file path - get just the file path (no name)
- GET file info - get characteristics of the file
- GET window info - get characteristics of the window
- GET window <num> - get 'window-pointer' for window N
- GET line <num> - return text of line
- GET select position - return start and end points of select range
- GET select text - return the string that is selected
- GET select next - used after 'get select text' to get later lines
-
- Specific info about each command...
-
- GET cursor position
-
- 'result' set to:
-
- "x y" = column & line numbers, both 0-based (ex: "0 13"
- to indicate first column of the fourteenth line).
- Use "PARSE var result col ' ' line" in AREXX scripts.
-
- "SELECT" = There is no cursor (a selection exists).
-
- GET cursor char
-
- 'result' set to:
-
- "c" = a single-character string (or "-1" if on empty line)
-
- "SELECT" = There is no cursor as a selection exists.
-
- GET file name 'result' set to "filename"
-
- GET file path 'result' set to "vol:dir/" or "vol:" format
-
- GET file info 'result' set to "string" describing characteristics
-
- 'result' set to:
-
- "modified? numLines size-in-mem size-on-disk"
-
- where:
-
- modified? = "YES" or "NO"
-
- numLines = number of lines in memory
-
- size-in-mem = number of characters in memory
-
- size-on-disk = number of characters on disk (-1 if
- file doesn't exist or error)
-
- GET window info 'result' set to "string" describing characteristics
-
- 'result' set to:
-
- "left top width height numVisLines numVisChars"
-
- where:
-
- left = window left edge
-
- top = window topedge
-
- width = window width
-
- height = window height
-
- numVisLines = height in visible text lines
-
- numVisChars = width in visible characters
-
- NOTE: all coordinates relative to screen 0,0
-
- GET window <num> obtain the 'window-pointer' for window N
-
- <num> must be in the range of from 1 to number-of-windows.
-
- This command is especially useful for doing something to
- each open Textra window, when used in combination with
- the SELECTWINDOW command.
-
- ONE SHOULD BE AWARE OF THE FOLLOWING CAVEAT WHEN USING
- THIS COMMAND VARIANT: If a window is closed by any
- means (meaning the 'number-of-windows' is lowered), one
- cannot assume that the same 'window-pointer' value will
- be returned for the same <num> argument. For example,
- if 'GET window 2' returns -148200, and then window 1
- is closed, 'GET window 2' may now be invalid (if there
- is only 1 window left), and 'GET window 1' will now
- return the -148200 window value. (This is not a
- consideration if new windows are opened, just when they
- are closed.)
-
- 'result' set to:
-
- 'window-pointer' = if <num> was in range
- 0 = if <num> was out of range
-
- GET line <num>
-
- 'rc' set to:
-
- 10 = <num> is too large (the specified line doesn't exist),
-
- otherwise, 'result' set to:
-
- "line text" = contents of line <num>
-
- GET select position
-
- 'result' set to:
-
- "startx starty endx endy" = select range coordinates.
-
- (For example, "0 0 2 4" indicates that from the first
- column of the first line to the third column of the fifth
- line is selected. From AREXX, use:
- PARSE var result startx' 'starty' 'endx' 'endy )
-
- "NO SELECT" = There is no selection.
-
- GET select text "(num) selected text" | "NO SELECT"
-
- Used to retrieve the current selection, or at least
- the component of it that is on the first line. The
- first portion of the returned string is always the number
- of remaining lines that can be returned via "GET select next".
- This number is always followed by a SPACE character, then the
- selected text on that line.
-
- For example, if "0 Four score" is returned, the caller knows
- that the selection does not extend over 1 line and that the
- selected text is "Four Score".
-
- If "1 seven years ago," is returned, the caller knows
- that the selected text is "seven years ago," and that
- the selection extends over to the next line (see
- "GET select next").
-
- 'result' set to:
-
- "<num> selected text" = <num> is number of times to call
- "GET select next" (separated by a
- SPACE character from the text).
-
- "NO SELECT" = no selection currently exists.
-
- GET select next "numleft selected text" | "NO SELECT"
-
- Used to retrieve remaining lines, if the previous
- "GET select text" indicated it should be called at all.
- It returns the same format string as "GET select text",
- but will return a 'numleft' component that decreases
- by 1 each time, ultimately to zero.
-
- 'result' set to: same as "GET select text"
-
- NOTE: returns just "0" if called past end of selection.
-
-
- WAITFOR num
-
- Wait for 'num' seconds, where 'num' is a decimal number of
- the form "4.36" or "4". Minimum resolution is .02 seconds,
- and with the speed AREXX operates at, that should be quite
- sufficient!
-
-
- CLEAR
-
- Delete all text from and blank the current window.
- rc = 30 if window is write protected, otherwise 0
-
-
- NOTIFY "token"
-
- Presents a standard informational 'Please Note!' requester
- to the user and waits for him/her to click the single 'OK'
- button. The token string is presented in the requester
- and should not exceed 60 characters in length. Does not
- return a result. rc always = 0.
-
-
- ASK "token"
-
- Presents a standard 'YES/NO' requester to the user and waits
- for him/her to click on a button. The token string
- is presented in the requester and should not exceed 60
- characters in length. rc always = 0.
-
- 'result' set to:
-
- "YES" or "NO", depending of course on which button was clicked.
-
-
- TEXTRAVERSION (only in v1.12 and later)
-
- Returns a string describing the TEXTRA major and minor versions,
- as well as the incremental version of the AREXX interface
- (increments with each release that contains a modification to
- the interface code and/or command set).
-
- format: major-version minor-version rexxinterface
-
- for example: 1 12 2
-
- "1 12 2" will be returned for v1.12, last 2 indicates
- AREXX interface, rev2. This should increment with
- every release that contains an ARexx interface
- addition, deletion, modification, or fix.
-
- "1 13 5" is returned for 1.13
-
- The 3rd digit will never be less than 2, as it was that rev
- which implemented this command.
-
- The commands in the following list have been added since the
- initial V1.10 release (which first incorporated the ARexx
- interface). For best results, you should check for the highest
- relevant rexx version at the beginning of your script (rexx
- code for checking shown below)...
-
- min Rexx revision needed for command
- ----------------- ------------------
- 2 (v1.12) OPENFILE, FINDFILE, SELECTWINDOW, SAVEAS
-
- 5 (v1.13) INSERTFILE, CHECKCANCEL, CLOSEWINDOW,
- RETURNPROMPT, RETURNPROMPTN,
- PREFS Alphanumeric, PREFS AlphanumericHops,
- address Textra (with no command string)
-
- 6 (v1.14) QUITTEXTRA
-
- 12 (v1.15) MARKSELECT, GOTOMARK, DELETEMARK,
- PREFS WrapFind [action], GOTOXY1,
- STATUSTEXT, LINE, LINE1, COLUMN, COLUMN1,
- GET file info, GET window info,
- GET window <num>, OPENFILEWAIT
-
- For example, if the most recent command listed that your
- script uses is CHECKCANCEL, you will want to check for
- rexx ver of 5. However, if you call QUITTEXTRA, you will need
- rexx ver 6.
-
- Note that not checking for an appropriate rexx version will
- not crash older, incompatible versions of the editor, but the
- user may be confronted with less-explanatory 'unknown
- command' error requesters. Checking the rexx ver is how you
- can explain just what the problem is.
-
- The following ARexx example illustrates how to check for a
- specific rexx version. This example checks for rexx ver of
- 5, indicated by the "(rex < 5)" statement on the 6th line:
-
- options results
-
- rex = 0; result = "NOTSUPPORTED"
- textraversion
- parse var result maj min rex
- if (result == "NOTSUPPORTED") | (rex < 5) then do
- notify "Textra V1.13 or later required for this script."
- exit
- end
-
- As of V1.13, all release TEXTRA scripts check that the
- TEXTRA that is calling them is of a compatible version as
- appropriate.
-
-
- CHECKCANCEL
-
- Checks whether the user wants to cancel the command. To
- respond accordingly, the programmer should put something like
- this in his/her ".textra" script:
-
- /* Check if the user wants to cancel... */
- CheckCancel; if (result == CANCEL) then exit
-
- Note that the script has the ability to perform specific actions
- before exiting, such as flushing data for example.
-
- 'result' set to:
-
- "CANCEL" The user wants to cancel current operation
-
- "NO" Do not cancel
-
-
- RETURNPROMPT "string"
-
- Presents the specified string as a prompt, then waits for the user
- to press the RETURN or ENTER keys. Until either is pressed, other
- keys are entered into the document as usual. (If the specified
- string is entered as "noprompt", none is presented).
-
- When the user presses RETURN, 4 values are returned as the
- 'result' string. These represent the starting x, y and ending x,
- y coordinates for the "response".
-
- The response is considered to be either:
-
- - Any selected text. (OR, if no text is selected...)
-
- - The cursor position when the command was invoked is
- considered the start x, y. The end x, y is the position
- when the RETURN key was pressed.
-
- 'result' set to:
-
- "WRITE PROTECTED" = window must be unlocked via WRITEENABLE
-
- "startx starty endx endy" = successful query
-
- This can be retrieved via:
-
- parse var result startx starty endx endy
-
-
- RETURNPROMPTN "string"
-
- Works exactly as does RETURNPROMPT, but also adds a NEWLINE after
- the prompt is displayed, allowing the response to occupy an entire
- line.
-
- See RETURNPROMPT for all other details.
-
-
- QUITTEXTRA <exit-save-action>
-
- There are 3 possible forms of this command:
-
- QUITTEXTRA prompt (normal shutdown, prompts if files modified)
- QUITTEXTRA save (doesn't prompt, always saves modified files)
- QUITTEXTRA nosave (doesn't prompt, doesn't save modified files)
-
- NOTE: The last two forms of this command have special user
- interface considerations.
-
- Users of a script containing such a command may not desire to have
- their files saved, almost certainly not discarded. Use carefully!
- Make sure others know if you use either of these forms. (None of
- the release scripts use any form of the QUITTEXTRA command).
-
- Note that Textra will not exit if a print job is active. If an ARexx
- script is running, the exit is postponed until the script finishes.
-
-
- MARKSELECT <Mark name>
-
- Create a mark called <Mark name> (will be truncated
- to 31 characters maximum length), which will be
- associated with the currently-selected text. The
- name will be made available to the GUI as well as
- the GOTOMARK and DELETEMARK commands.
-
- Note that an existing mark of the same <Mark name>
- will be replaced with the new mark.
-
- 'result' set to:
-
- "OK" - Mark defined
-
- "NO" - an error prevented definition of the mark
-
- "NO SELECT" - no select range is highlighted to mark.
-
- "WRITE PROTECTED" - window must be unlocked via WRITEENABLE
-
-
- GOTOMARK <Mark name>
-
- Select and display the text corresponding to
- <Mark name>.
-
- 'result' set to:
-
- "OK" - Mark selected and displayed
-
- "NOT FOUND" - no mark exists of that name
-
-
- DELETEMARK <Mark name>
-
- Delete the mark called <Mark name>.
-
- 'result' set to:
-
- "OK" - Mark deleted
-
- "NOT FOUND" - no mark exists of that name
-
- "WRITE PROTECTED" - window must be unlocked via WRITEENABLE
-
-
- STATUSTEXT "Text string"
-
- Displays the passed-in text in the status line, replacing the
- previous status line display. (The normal status line
- display can be recovered at any time by clicking on the
- status line.)
-
-
- ===================================================================
- File/Window Management
- ===================================================================
-
-
- Some of the commands in this section deal with a parameter called
- a 'window-pointer'. These may be saved by your program and later
- used to select the active window. They are valid as long as that
- window is open. This parameter is bound to the window, not the
- file. As a result, it always describes the same window, even if
- the filename of that window changes (perhaps via SAVEAS).
-
- See also the 'GET window <num>' command, which also returns a
- 'window-pointer'.
-
-
- OPENFILE "filename"
-
- Reads in the specified file from disk, unless the file is
- already open. TEXTRA first expands the "filename" to it's
- full pathname equivalent, then checks the titles of it's
- current windows for a match.
-
- If the specified file is already open, it is brought to the
- front and the cursor is set to 0,0 (just as if the file was
- freshly opened).
-
- If the specified file is not open, and can't be found on the
- disk, an empty window is created and given the specified
- filename.
-
- NOTE: Do not pass a string that describes a directory to
- OPENFILE. It will create a window, then present the
- file requester on that directory, thereby requiring
- user input via the mouse. Currently, OPENFILE does not
- wait for the selection before returning to the AREXX
- script, which operates on the window in that condition
- (with the requester in place). (This will be protected
- against in a future version.)
-
- 'result' set to:
-
- "window-pointer" = descriptor to later use to re-select this
- window (see SELECTWINDOW)
-
- "0" = window could not be opened
-
-
- OPENFILEWAIT "filename"
-
- Works identically to OPENFILE, except that this command will
- not return until the edited window is closed.
-
- THIS COMMAND IS ONLY FOR USE FROM EXTERNAL PROGRAMS. DO NOT
- EXECUTE THIS COMMAND FROM TEXTRA, EITHER IN A SCRIPT OR
- AS A DIRECT COMMAND.
-
- This command was added to support programs like mail readers,
- which sometimes expect the editor to NOT return until the
- user is finished with the specified document.
-
-
- FINDFILE "filename"
-
- TEXTRA first expands the "filename" to it's full pathname
- equivalent, then checks the titles of it's current windows
- for a match.
-
- If the filename is found, it is brought to the
- front and the associated 'window-pointer' is returned.
-
- FINDFILE is similar to OPENFILE, except that it never
- creates a new window.
-
- 'result' set to:
-
- "window-pointer" = descriptor to later use to re-select this
- window (see SELECTWINDOW)
-
- "0" = filename not found as a window title
-
-
- INSERTFILE "filename"
-
- Reads the specified file into the selected window at the
- current cursor/select position. v1.13 and later (only)
-
- 'result' set to:
-
- "OK" = FIle found and inserted
- "NOT FOUND" = passed in filename could not be located
- "WRITE PROTECTED" = selected file is write protected
-
-
- SELECTWINDOW "window-pointer"
-
- The specified window is brought to the front and made
- the current window.
-
- The window-pointer parameter must have been aquired from
- either OPENFILE or FINDFILE, and the window must still be
- open.
-
- v1.13 and later (only)... SELECTWINDOW returns...
-
- "OK" = Window found and selected
- "NOT FOUND" = passed in value was not a valid window-
- pointer
-
-
- SAVEAS "filename"
-
- The currently selected window is saved to disk under the
- specified name.
-
- If the specified filename is a single asterisk, i.e. "*",
- the file will be written under the currently existing
- filename (equivalent to a SAVE operation).
-
- 'result' set to:
-
- "OK" = file successfully written
- "ERROR" = some error occured, file not saved
- "NOT FOUND" = "filename" either describes a directory
- or contains an invalid pathname component
- "FILE NOT NAMED" = a "*" has been specified, but the file has
- never been given a name
-
-
- CLOSEWINDOW
-
- The currently selected window is closed unless it is the
- last window.
-
- 'result' set to:
-
- "RANGE ERROR" = file is the last one open (can't be closed
- via ARexx)
- "window-pointer" = the selected window was closed, the returned
- "file-pointer" is for the new selected window
-
- PLACEWINDOW leftedge topedge width height
-
- Positions the window to the supplied screen-relative coordinates.
- Example: PlaceWindow 20 20 300 100
-
- If successful, one might want to perform a 'GET window info'
- operation, to obtain the new value for number-of-visible-lines
- and number-of-visible-chars, which are both dependant on the
- user-selected font.
-
- If -1 is used for any input parameter, no change in that window
- dimension (only) will be made. For example...
-
- PLACEWINDOW "-1" "-1" "-1" "-1" /*arexx needs the quotes*/
-
- ...will not change the window position at all.
-
- result set to:
-
- "RANGE ERROR" = supplied coordinates are too large, too small
- or OS error
- "OK" = Window successfully placed
-
-
- WRITEPROTECT
-
- Identical to the menu item behavior, "locks" the window against
- changes by either the user or ARexx. Commands which normally
- change window text will set rc=30 and, if appropriate,
- return result="WRITE PROTECTED".
-
-
- WRITEENABLE
-
- Identical to the menu item behavior, "unlocks" the window allowing
- changes by both user and ARexx. All commands operate normally.
-
-
- Revision History
- ----------------
-
- v1.10 (Did not support the TEXTRAVERSION command)
- - Initial ARexx release
-
- v1.11 (Did not support the TEXTRAVERSION command)
- - Fixed GET CURSOR CHAR problem (probable crash
- if cursor was at the end of a line)
-
- These flavors are represented by the third digit in the
- TEXTRAVERSION ARexx command. Refer to the text for that
- command.
-
- v1.12 (TEXTRAVERSION returns 1 12 2)
- - Replace WRAPAT.textra script with PARAGRAPH.textra
- - Added File/Window Management section
- - Added TEXTRAVERSION command
-
- v1.13 (TEXTRAVERSION returns 1 13 5)
- - Select "next word"-type words will now select
- Alpha-NUMERIC strings. (Earlier versions only selected
- alphabetics) (Beta2)
- - If no "s:Textra.cmds" file exists, default strings are
- placed in the ARexx requester string gadgets (including
- one "@command"-type ARexx STRING FILE as an example).
- (Beta2)
- - Added INSERTFILE <filename> (Beta3)
- - TEXTRAVERSION returns "1 13 3" (Beta2 was still "1 13 2")
- (Beta3)
- - '.textra' ARexx scripts can now be used like normal commands
- inside other '.textra' ARexx scripts. (Beta3)
- - Fixed problem in ARexx interface that would cause a deadlock
- if 'address "TEXTRA"' was used within a .textra script (Beta7)
- - CLOSEWINDOW command (Beta9)
- - CHECKCANCEL command (Beta9)
- - version returns 1 13 4 (Beta12)
- - SELECTWINDOW was broken in Beta8... window would become active,
- but all subsequent events went to previously-selected window!
- (Beta12)
- - Added the following attributes to PREFS command/1 13 5 (Beta14)
- [Alphanumeric] [read on off]
- [AlphanumericHops] [read on off]
-
- v1.14 (TEXTRAVERSION returns 1 14 6)
- - Added the QUITTEXTRA command
- - Fixed a possible crash in the CLEAR command
- - Fixed a possible crash in the CLOSEWINDOW command
-
- v1.15 (TEXTRAVERSION returns 1 15 12)
- - Added the MARKSELECT command
- - Added the GOTOMARK command
- - Added the DELETEMARK command
- - Added the PREFS WrapFind [on off read] attribute
- - removed [ConvertCRLF] option for PREFS command as Textra
- is now MSDOS-text-compatible.
- - Added the GOTOXY1 and STATUSTEXT commands.
- - Added the 'GET file info', 'GET window info', 'GET window <num>'
- and the PLACEWINDOW commands
- - Added the LINE, LINE1, COLUMN and COLUMN1 commands
- - (Beta9) When Write-protected, commands which don't change
- window will work. (In beta8, nothing but WRITEENABLE
- worked... the files.textra scripts would fail if
- a write-protected window existed. Also, rexx commands
- which write to file now report errors. (rexxver to 11)
- - Added the OPENFILEWAIT command (rexxver to 12)
-
- v1.16 (TEXTRAVERSION returns 1 16 12 in Beta7)
- - Documented the INSERTFILE command (somehow never got in here?)
-
-